package com.codejob.portal.dao.impl.project;



import org.springframework.stereotype.Component;

import com.codejob.portal.dao.intf.HibernateDao;
import com.codejob.portal.dao.utils.Page;
import com.codejob.portal.entity.project.Projects;
@Component
public class ProjectDaoImpl extends HibernateDao<Projects, Long> {

	public Page<Projects> getProjectFilterPage(Page<Projects> page,
			String typeFilter) {
		String hql="";
		if(page.getOrderBy()!=null&&page.getOrder()!=null){
			hql ="select p from Projects p where p.projType.group='"+typeFilter+"' order by "+page.getOrderBy()+" "+ page.getOrder() ;
		}else{
			hql ="select p from Projects p where p.projType.group='"+typeFilter+"'";
		}
		
		return this.findPage(page, hql);
	}
	
}
